]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-texture-cache: Fix a minor crash when computing our border-radius
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 13 Oct 2011 01:15:36 +0000 (21:15 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 13 Oct 2011 18:15:18 +0000 (14:15 -0400)
If we add a 0-sized actor with a border-radius, we will crash as we try to
allocate a 0-sized texture in Cogl. Bail out early instead of doing that.

https://bugzilla.gnome.org/show_bug.cgi?id=661617

src/st/st-theme-node-drawing.c

index b4d9e900e1e342b9d96a75d755ec7b521d88711c..440ca138a844a8fe74ddaecd40db5df6c49be964 100644 (file)
@@ -342,12 +342,13 @@ st_theme_node_lookup_corner (StThemeNode    *node,
   StCornerSpec corner;
   guint radius[4];
 
-  if (node->border_radius[corner_id] == 0)
-    return COGL_INVALID_HANDLE;
-
   cache = st_texture_cache_get_default ();
 
   st_theme_node_reduce_border_radius (node, radius);
+
+  if (radius[corner_id] == 0)
+    return COGL_INVALID_HANDLE;
+
   corner.radius = radius[corner_id];
   corner.color = node->background_color;
   st_theme_node_get_corner_border_widths (node, corner_id,